package com.cinsea.zbc.ext;

import com.cinsea.common.BasePX;
import com.cinsea.common.Env;
import com.cinsea.common.JdbcDao;
import com.cinsea.util.StringUtil;
import java.util.Map;

public class ZbcPX extends BasePX {

    @Override
    public void after(Map map) {
        super.after(map);
        JdbcDao dao = Env.getBean("jdbcDao");
        String dowid = "";
        String currentDowid = StringUtil.null2String(map.get("dowid"));
        String processid = StringUtil.null2String(map.get("processid"));
        String sql = "select xmfl from ut_workorderoffer where processid=?";
        Map xmflMap = dao.queryForMap(sql, new Object[]{processid});
        String xmfl = StringUtil.null2String(xmflMap.get("xmfl"));
        if(xmfl.equals("4028810840ecba990140ecd48c470004")){//A
            dowid="8ad0828f410ae25901410b661cae002c";
        }else if(xmfl.equals("4028810840ecba990140ecd4a4dc0005")){//B

            dowid="4028810e4201ec2c0142033c316d00e5";

        }else if(xmfl.equals("4028810840ecba990140ecd4bf770006")){//C

            dowid="4028818537bf671b0137bf7a4ecb0006";
        }else{
            dowid="";
        }
        if(!dowid.equals("")){
            sql = "update cs_formprocess set dowid=? where id=?";
            dao.update(sql,new Object[]{dowid,processid});
            sql = "update ut_workorderoffer set dowid=? where processid=?";
            dao.update(sql , new Object[]{dowid,processid});
        }
    }
}
